//
//  UserTableView.m
//  SZBank
//
//  Created by LuoYao on 16/7/15.
//  Copyright © 2016年 LuoYao. All rights reserved.
//

#import "UserTableView.h"

@interface UserTableView ()
{
    CGFloat _cwidth,_cheight;
}
@end

@implementation UserTableView
- (instancetype)initWithFrame:(CGRect)frame lineColor:(UIColor *)lineColor
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _cwidth = frame.size.width;
        _cheight = frame.size.height;
        
        NSArray *array = @[@"djqhfefenbfhwebfhwfbwevfwevf",@"281264723647234623t3g2vgvwdfe"];
        
        for (int i = 0; i < array.count; i ++) {
            //线条
            UILabel *rowLine = [[UILabel alloc] initWithFrame:CGRectMake(0, i * 100, _cwidth, 1)];
            rowLine.backgroundColor = lineColor;
            
            [self addSubview:rowLine];
            
            //显示文字
            UILabel *textLine = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(rowLine.frame) + 10, _cwidth, 100)];
            textLine.text = array[i];
            
            [self addSubview: textLine];
            
            
            //竖线条
            UILabel *leftLine = [[UILabel alloc] initWithFrame:CGRectMake(0, i * 100, 1, textLine.bounds.size.height)];
            leftLine.backgroundColor = lineColor;
            [self addSubview:leftLine];
            
            
            
            UILabel *rightLine = [[UILabel alloc] initWithFrame:CGRectMake(_cwidth - 1, i * 100, 1, textLine.bounds.size.height)];
            rightLine.backgroundColor = lineColor;
            [self addSubview:rightLine];
            
            
            
            if (i == array.count - 1) {
                UILabel *bottomLine = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(rightLine.frame), _cwidth, 1)];
                bottomLine.backgroundColor = lineColor;
                [self addSubview:bottomLine];
                
                
                
            }
            
        }
    }
    return self;
}


@end
